#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{
    int a = 0, h = 0, b = 0, k = 0;
    cin >> a >> h >> b >> k;
    long long dam = 0;
    while (h > 0 && k > 0)
    {
        dam += (a + b);
        h -= b;
        k -= a;
    }
    if (h > 0)
    {
        dam += (10 * a);
    }
    if (k > 0)
    {
        dam += (10 * b);
    }
    cout << dam << endl;
    return 0;
}
